#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <wiringPi.h>
#include <unistd.h>
int main(int argc,char**argv){
	char buf[1024] = "";
	memset(buf,0,sizeof(buf));

int fd = open("/dev/first_chr_dev",O_RDONLY);
	if(fd < 0){

		perror("open first_chr_dev");
	}
	int ret = read(fd,buf,sizeof(buf));
	if(ret  < 0){
		perror("read first_chr_dev");
	}else{
		printf("buf:%s(%d)\n",buf,ret);
	}
	wiringPiSetup();
	pinMode(2,OUTPUT);
	digitalWrite(2,HIGH);
	sleep(2);
	digitalWrite(2,LOW);
	return 0;
	
}





